#pragma once
#include "BVHnode.h"
#include "Intersection.h"
#include "Scene.h"
#include <list>
using namespace std;
//class Scene;
class BVH{
public:
	BVH();
	~BVH();

	//Top-down build
	bool build(Scene *_s, int _g);		//pass in the target number of shapes per leaf node

	bool intersect(Intersection &_int);

	void scene(Scene *_s){ theScene = _s; }

private:
	BVHnode root;
	Scene *theScene;
	list<Shape*> theShapes;
	list<Shape*> theUnboundedShapes;	//this is a list for unbounded shapes like infinite planes
};

